<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
// This tests that inserting a newline in place of a full line of quoted content doesn't add an extra quoted line.
// The test has passed if there are no empty lines (quoted or unquoted) in the root editable div.
selection_test(
    [
      '<div contenteditable><blockquote type="cite">',
        '<div>quoted</div>',
        '<div>|quoted</div>',
        '<div>quoted</div>',
      '</blockquote></div>'
    ].join(''),
    selection => selection.modify('extend', 'forward', 'line'),
    [
      '<div contenteditable><blockquote type="cite">',
        '<div>quoted</div>',
        '<div>^quoted</div>',
        '<div>|quoted</div>',
      '</blockquote></div>'
    ].join(''),
    'Step 1');

selection_test(
    [
      '<div contenteditable><blockquote type="cite">',
        '<div>quoted</div>',
        '<div>^quoted</div>',
        '<div>|quoted</div>',
      '</blockquote></div>'
    ].join(''),
    'InsertNewLineInQuotedContent',
    [
      '<div contenteditable>',
        '<blockquote type="cite"><div>quoted</div><div></div></blockquote>',
        '|<br>',
        '<blockquote type="cite"><div>quoted</div></blockquote>',
      '</div>'
    ].join(''),
    'Step 2');

selection_test(
    [
      '<div contenteditable>',
        '<blockquote type="cite"><div>quoted</div><div></div></blockquote>',
        '|<br>',
        '<blockquote type="cite"><div>quoted</div></blockquote>',
      '</div>'
    ].join(''),
    'InsertText unquoted',
    [
      '<div contenteditable>',
        '<blockquote type="cite"><div>quoted</div><div></div></blockquote>',
        'unquoted|<br>',
        '<blockquote type="cite"><div>quoted</div></blockquote>',
      '</div>'
    ].join(''),
    'Step 3');
</script>
